import os


class Config:
    # 数据库配置
    SQLALCHEMY_DATABASE_URI = os.getenv(
        'DATABASE_URL', 'postgresql://user:password@localhost/mindcare')
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # JWT配置
    JWT_SECRET_KEY = os.getenv('JWT_SECRET_KEY', 'your_jwt_secret_key')
    JWT_ACCESS_TOKEN_EXPIRES = 900  # 15分钟
    JWT_REFRESH_TOKEN_EXPIRES = 604800  # 7天

    # Redis配置
    REDIS_URL = os.getenv('REDIS_URL', 'redis://localhost:6379/0')

    # 短信服务配置（以阿里云为例）
    SMS_ACCESS_KEY_ID = os.getenv('SMS_ACCESS_KEY_ID')
    SMS_ACCESS_KEY_SECRET = os.getenv('SMS_ACCESS_KEY_SECRET')
    SMS_SIGN_NAME = 'MindCare'
    SMS_TEMPLATE_CODE = 'SMS_123456789'

    # 云存储配置（以AWS S3为例）
    AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID')
    AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY')
    S3_BUCKET_NAME = 'mindcare-avatars'
